-module(rec_in_pattern).

-include_lib("ect/include/ect.hrl").

-import_class(pattern1).
-import_class(pattern2).

-record(rrr, {a, b, c}).

-export([dotest/0]).

dotest() ->
    P2 = #pattern2{b = #rrr{a = x, b = pass}},
    T1 = extract(P2),
    T2 = extract2(P2),
    T1 = T2.

extract(#pattern2{b = #rrr{a = Z, b = X}}) when Z =:= x ->
    X.

extract2(Obj) ->
    #pattern2{b = #rrr{a = x, b = Pass}} = Obj,
    Pass.